/*
 * Copyright (c) 2022-2022 All rights Reserved.
 */

package com.driving.core.service.dto;

import com.driving.core.base.AbstractDTO;
import com.driving.core.entity.StudentApply;
import com.driving.core.mapper.type.Gender;
import com.driving.core.mapper.type.LicenseType;

import lombok.Getter;
import lombok.Setter;

/**
 * 学员报名接收器
 *
 * @author SAGITTAR
 * @since 2017
 */
@Getter
@Setter
public class ApplyDTO extends AbstractDTO {

    private Integer studentId;

    private String name;

    private Integer sex;

    private String mobile;

    private String email;

    private String idNumber;

    private Long schoolId;

    private Long coachId;

    private String learnType;

    public StudentApply toStudentApply() {
        StudentApply studentApply = new StudentApply();
        studentApply.setStudentId(studentId);
        studentApply.setName(name);
        studentApply.setGender(Gender.from(sex));
        studentApply.setMobile(mobile);
        studentApply.setEmail(email);
        studentApply.setIdNumber(idNumber);
        studentApply.setSchoolId(schoolId);
        studentApply.setCoachId(coachId);
        studentApply.setLearnType(LicenseType.fromType(learnType));
        return studentApply;
    }
}
